﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// Graduations 的摘要说明
/// </summary>
public class Graduations
{
	public Graduations()
	{
		//
		// TODO: 在此处添加构造函数逻辑
		//
	}
    public void GetGraduations(string layname,int nGraduations,ref string strGraduations)
    {
        //长势分级,品质预报分级,品质遥感监测
        if (layname == "长势分级")
        {
            switch(nGraduations)
            {
                case 2:
                    strGraduations = "0.1,3.5,";
                    break;
                case 3:
                    strGraduations = "0.1,3.5,5.5,";
                    break;
                case 4:
                    strGraduations = "0.1,3.5,5.5,6.5,";
                    break;
                case 5:
                    strGraduations = "0.1,3.5,5.5,6.5,8,";
                    break;
                default:
                    strGraduations = "";
                    break;
            }
        }
        if(layname=="品质预报分级")
        {
            switch (nGraduations)
            {
                case 2:
                    strGraduations = "0,0.01,";
                    break;
                case 3:
                    strGraduations = "0,0.01,0.02,";
                    break;
                case 4:
                    strGraduations = "0,0.01,0.02,0.04,";
                    break;
                case 5:
                    strGraduations = "0,0.01,0.02,0.04,0.08,";
                    break;
                default:
                    strGraduations = "";
                    break;
            }
        }
        if (layname == "品质遥感监测")
        {
            switch (nGraduations)
            {
                case 2:
                    strGraduations = "12,13,";
                    break;
                case 3:
                    strGraduations = "12,13,14,";
                    break;
                case 4:
                    strGraduations = "12,13,14,15,";
                    break;
                case 5:
                    strGraduations = "12,13,14,15,16,";
                    break;
                default:
                    strGraduations = "";
                    break;
            }
        }
    }
    public void GetLablesGraduations(string layname, int nGraduations, ref string strLabels)
    {
        if (layname == "长势分级")
        {
            switch (nGraduations)
            {
                case 2:
                    strLabels = "差,好,";
                    break;
                case 3:
                    strLabels = "差,持平,好,";
                    break;
                case 4:
                    strLabels = "差,持平,较好,好,";
                    break;
                case 5:
                    strLabels = "差,较差,持平,较好,好,";
                    break;
                default:
                    strLabels = "";
                    break;
            }
        }if(layname=="品质预报分级")
        {
            switch (nGraduations)
            {
                case 2:
                    strLabels = "弱筋麦,强筋麦,";
                    break;
                case 3:
                    strLabels = "弱筋麦,中筋麦,强筋麦,";
                    break;
                case 4:
                    strLabels = "弱筋麦,中筋麦,中强筋麦,强筋麦,";
                    break;
                case 5:
                    strLabels = "弱筋麦,中弱筋麦,中筋麦,中强筋麦,强筋麦,";
                    break;
                default:
                    strLabels = "";
                    break;
            }
        }
        if (layname == "品质遥感监测")
        {
            switch (nGraduations)
            {
                case 2:
                    strLabels = "弱筋麦,强筋麦,";
                    break;
                case 3:
                    strLabels = "弱筋麦,中筋麦,强筋麦,";
                    break;
                case 4:
                    strLabels = "弱筋麦,中筋麦,中强筋麦,强筋麦,";
                    break;
                case 5:
                    strLabels = "弱筋麦,中弱筋麦,中筋麦,中强筋麦,强筋麦,";
                    break;
                default:
                    strLabels = "";
                    break;
            }
        }
    }
    public void GetColorsGraduations(string layname, int nGraduations, ref string strColors)
    {
        if (layname == "长势分级")
        {
            switch (nGraduations)
            {
                case 2:
                    strColors = ImsColor.lightgreen + "," + ImsColor.darkorange;
                    break;
                case 3:
                    strColors = ImsColor.lightgreen + "," + ImsColor.darkgreen + "," + ImsColor.yellow;
                    break;
                case 4:
                    strColors = ImsColor.lightgreen + "," + ImsColor.darkgreen + "," + ImsColor.yellow + "," + ImsColor.darkorange;
                    break;
                case 5:
                    strColors = ImsColor.lightgreen + "," + ImsColor.darkgreen + "," + ImsColor.yellow + "," + ImsColor.darkorange + "," + ImsColor.red;
                    break;
                default:
                    strColors = "";
                    break;
            }
        } if (layname == "品质预报分级")
        {
            switch (nGraduations)
            {
                case 2:
                    strColors = ImsColor.lightgreen + "," + ImsColor.darkorange;
                    break;
                case 3:
                    strColors = ImsColor.lightgreen + "," + ImsColor.darkgreen + "," + ImsColor.yellow;
                    break;
                case 4:
                    strColors = ImsColor.lightgreen + "," + ImsColor.darkgreen + "," + ImsColor.yellow + "," + ImsColor.darkorange;
                    break;
                case 5:
                    strColors = ImsColor.lightgreen + "," + ImsColor.darkgreen + "," + ImsColor.yellow + "," + ImsColor.darkorange + "," + ImsColor.red;
                    break;
                default:
                    strColors = "";
                    break;
            }
        }
        if (layname == "品质遥感监测")
        {
            switch (nGraduations)
            {
                case 2:
                    strColors = ImsColor.lightgreen + "," + ImsColor.darkorange;
                    break;
                case 3:
                    strColors = ImsColor.lightgreen + "," + ImsColor.darkgreen + "," + ImsColor.yellow;
                    break;
                case 4:
                    strColors = ImsColor.lightgreen + "," + ImsColor.darkgreen + "," + ImsColor.yellow + "," + ImsColor.darkorange;
                    break;
                case 5:
                    strColors = ImsColor.lightgreen + "," + ImsColor.darkgreen + "," + ImsColor.yellow + "," + ImsColor.darkorange + "," + ImsColor.red;
                    break;
                default:
                    strColors = "";
                    break;
            }
        }
    }
}
